package com.example.novelstory.controller.qjl;

import com.example.novelstory.entity.VipUser;
import com.example.novelstory.service.qjl.VipUserServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "会员中心")
@CrossOrigin
@RestController
public class VipuserController {
    @Resource
    VipUserServiceImpl vipUserService;

    @PostMapping(value = "/findAll1")
    @ApiOperation(value = "vip查询")
    public List<VipUser> findAll1() {

        return vipUserService.findAll1();
    }
    @PostMapping(value = "/insert1")
    @ApiOperation(value = "添加")
    public boolean addVipuser(@RequestBody VipUser vipuser){
        return vipUserService.addVipuser(vipuser);
    }

    @PostMapping(value = "/delete1")
    @ApiOperation(value = "删除")
    public boolean deleteVipuser(int id){

        return vipUserService.deleteVipuser(id);
    }

    @PostMapping(value = "/update1")
    @ApiOperation(value = "修改")
    public boolean updateVipuser(VipUser vipuser){

        return vipUserService.updateVipuser(vipuser);
    }
}
